package com.mike.billingserver.exception;

import com.mike.billingserver.enums.ResultEnum;

/**
 * @author xiaozefeng
 * @date 12/12/18 1:29 PM
 */
public class ServiceException extends RuntimeException {

    private static final long serialVersionUID = 6960600883384077738L;
    private int code;

    public ServiceException(String message, int code) {
        super(message);
        this.code = code;
    }

    public ServiceException(ResultEnum resultEnum) {
        super(resultEnum.getMsg());
        this.code = resultEnum.getCode();
    }

}
